<template>
    <div class="gray_page">
        <navbar @getCarList='getCarList'></navbar>
        <!-- <p class="padding_85"></p> -->
        <div class="list" v-if="showList" v-for="item in carList" :key="item.index" @click="goDetail(item)">
            <div class="pic_box">
                <img :src="item.imgUrl" alt="" class="pic"/>
                <p class="absolute_shade"></p>
               <!-- <img src="@/assets/icon_action.png" alt="" class="icon"> -->
            </div>
            <div class="content">
                <p class="title omit1">{{item.seriesName}} </p>
                <p class="price"><span><strong>{{item.minPrice}}</strong></span>万~<span><strong>{{item.maxPrice}}</strong></span>万</p>
               <!-- <p class="desc">定金付1元低购车1000元</p> -->
            </div>
        </div>

        <!-- <div class="public_loadingtip">暂无更多商品</div> -->
        <div class="public_undata" v-if="!showList">
            <img src="@/assets/icon_car.png" alt="" />
            <p>没有找到符合条件的商品 </p>
        </div>
    </div>
</template>

<script>
import navbar from '@/components/navbar.vue'
export default {
  name: '',
  components: {
    navbar
  },
  data () {
    return {
      showList: true,
      carList: []
    }
  },
  created () {
    // this.getShopList()
  },
  methods: {
    goDetail (item) {
      const seriesName = item.seriesName
      const brand = item.brandName
      this.$router.push({ path: '/shopdetail',
        query: {
          seriesName: seriesName,
          brand: brand
        }})
    },
    getCarList (list) {
      if (!list || list.length === 0) {
        this.showList = false
        return false
      } else {
        this.showList = true
      }
      this.carList = list
    }
  }
}
</script>

<style scoped>

.list{
    width:94%;
    min-height:136px;
    height:auto;
    padding:30px 3%;
    border-bottom: 1px solid #e7e7e7;
    background: #fff;
    display: flex;
}

.pic_box{
    position: relative;
    width:215px;
    height:auto;
    /* float: left; */
}

.pic{
    width:215px;
    height:161px;
    display: block;
    background:url('../../assets/bigcar.png');
    background-position:center;
    background-size:cover;
    border-radius: 5px;
}

.icon{
    position: absolute;
    left:0;
    top:0;
    width:52px;
    height:52px;
}

.content{
    width:450px;
    height:auto;
    margin-left:30px;
    /* float: left; */
}

.content > p{
    width:100%;
    height:auto;
}

.title{
    font-size: 28px;
    color: #323232;
    padding-top: 10px;
}

.price{
   font-size: 26px;
   color: #FF6B23;
   padding-top: 14px;
}

.price > span{
    font-size: 38px;
}

.desc{
    font-size: 28px;
    color: #999;
    padding-top: 12px;
}
image[lazy=loading] {
   width:215px;
   height:136px;
   margin: auto;
}
</style>
